package com.directions.android;

import android.content.Context;

import com.directions.route.Routing;
import com.directions.route.Routing.TravelMode;

public class BundleUtils {
	public static final String MARKER_ID = "m_id";
	public static final String MARKER_TITLE = "m_ttl";
	public static final String ORIG_LAT = "o_lat";
	public static final String ORIG_LONG = "o_lon";
	public static final String DST_LAT = "d_lat";
	public static final String DST_LONG = "d_lon";
	public static final String ROUTE = "rou";
	public static final String CURR_POS_ORIG = "o_current";
	public static final String CURR_POS_DST = "d_current";

	public String travelModeToStr(Context ctx, Routing.TravelMode route) {
		switch (route) {
		case WALKING:
			return ctx.getString(R.string.walking);
		case DRIVING:
			return ctx.getString(R.string.driving);
		case BIKING:
			return ctx.getString(R.string.biking);
		case TRANSIT:
			return ctx.getString(R.string.transit);
		default:
			return null;
		}
	}

	public static Routing.TravelMode strToTravelMode(Context ctx, String str) {
		if (str.equals(ctx.getString(R.string.biking)))
			return TravelMode.BIKING;
		if (str.equals(ctx.getString(R.string.driving)))
			return TravelMode.DRIVING;
		if (str.equals(ctx.getString(R.string.walking)))
			return TravelMode.WALKING;
		if (str.equals(ctx.getString(R.string.transit)))
			return TravelMode.TRANSIT;
		return null;
	}
}
